Update Knowledge
Used to update an existing knowledge base entry. This allows you to modify the content of files, text, Q&A pairs, or other knowledge types that have already been added to the knowledge base.
API Endpoint
| Property | Value |
|---|---|
| Request Method | POST |
| Request URL | https://api.seliseblocks.com/kb/update |
Request
Request Example
curl -X POST 'https://api.seliseblocks.com/kb/update' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"project_key": "YOUR_PROJECT_KEY",
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "qa",
"kb_id": "kb_12345",
"content": "To reset your password, navigate to Settings > Security > Change Password. Enter your current password, then your new password twice for confirmation. Click Save to complete the process.",
"question": "How do I reset my password?"
}'
Request Headers
| Field | Type | Required | Description |
|---|---|---|---|
| accept | string | Yes | Accepted response format. Use application/json |
| Content-Type | application/json | Yes | Data type, must be application/json. |
Request Body
Request Body Schema
{
"project_key": "string",
"agent_id": "string",
"type": "file",
"kb_id": "string",
"content": "string",
"question": "string"
}
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| project_key | string | Yes | The project key for your project. |
| agent_id | string | Yes | UUID of the AI agent associated with the knowledge entry. |
| type | string | Yes | Type of knowledge entry (e.g., file, text, qa, link). |
| kb_id | string | Yes | Unique identifier of the knowledge base entry to update. |
| content | string | No | Updated content for text-based entries or answer in Q&A pairs. |
| question | string | No | Updated question text (only applicable for Q&A type entries). |
note
Field Requirements by Type
- For
texttype: Onlycontentis required - For
qatype: Bothquestionandcontent(answer) are required - For
filetype: Update operations may vary based on implementation - For
linktype:contentmay represent the updated URL
tip
After updating a knowledge entry, the system will automatically:
- Re-process the updated content
- Re-generate embeddings for the new content
- Update the vector index
- Make the updated information available for retrieval
Response
Success Response (200 OK)
Returns an object containing the update status.
{
"is_success": true,
"detail": "Knowledge entry updated successfully",
"error": {}
}
Response Fields
| Field | Type | Description |
|---|---|---|
| is_success | boolean | Indicates whether the update was successful. |
| detail | string | Success or failure message with additional context. |
| error | object | Error details if the operation failed (empty if successful). |
Error Response (422 Unprocessable Entity)
Returns validation error details when the request body is invalid.
{
"detail": [
{
"loc": [
"body",
"kb_id"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}
Error Response Fields
| Field | Type | Description |
|---|---|---|
| detail | array | Array of validation error objects. |
| loc | array | Location of the error in the request (e.g., body field). |
| msg | string | Human-readable error message. |
| type | string | Error type identifier. |
Error Codes
| Status Code | Description | Response Type |
|---|---|---|
| 200 | Successful Response | Success |
| 400 | Bad Request - Invalid update data | Bad Request |
| 404 | Not Found - Knowledge entry does not exist | Not Found |
| 422 | Validation Error - Invalid request parameters | Unprocessable Entity |